<template>
    <div class="wrapper">
        <ul>
            <li v-for="(item, index) in arr" :key="index">
                <div class="rank">{{index+1}}</div>
                <div class="pic">
                    <img :src="item.src">
                </div>
                <div class="txt">
                    <div class="title">{{item.name}}</div>
                    <div class="hot">热度：<span>{{item.hot}}</span></div>
                </div>
            </li>
        </ul>
    </div>
</template>

<script>
import {rankArray} from '@/assets/data/home-rank.js'
export default ({
    name: 'HomeRank',
    data() {
        return {
            arr: rankArray
        }
    }
})
</script>

<style lang="scss" scoped>
.wrapper {
    ul {
        width: 100%;
        border-radius: 10px;
        overflow: hidden;
        li {
            padding: 15px 0;
            margin-bottom: 20px;
            box-sizing: border-box;
            background-color: #171717;
            color: white;
            display: flex;
            align-items: center;
            .rank {
                font-size: 20px;
                margin-left: 20px;
                flex-shrink: 0;
            }
            .pic {
                width: 100px;
                margin-left: 20px;
                flex-shrink: 0;
                img {
                    width: 100%;
                }
            }
            .txt {
                width: 50%;
                height: 150px;
                margin-left: 20px;
                flex-shrink: 0;
                position: relative;
                .title {
                    font-size: 20px;
                    margin-top: 15px;
                }
                .hot {
                    position: absolute;
                    font-size: 13px;
                    bottom: 15px;
                }
            }
        }
    }
}
</style>